/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FrameAdicionarLivro.java
 *
 * Created on 22/04/2012, 17:15:44
 */

package br.edu.fatec.ads.view;

import br.edu.fatec.ads.classes.Editora;
import br.edu.fatec.ads.classes.Idioma;
import br.edu.fatec.ads.classes.Livro;
import br.edu.fatec.ads.facade.FacadeAutor;
import br.edu.fatec.ads.facade.FacadeCategoria;
import br.edu.fatec.ads.facade.FacadeEditora;
import br.edu.fatec.ads.facade.FacadeIdioma;
import br.edu.fatec.ads.facade.FacadeLivro;
import br.edu.fatec.ads.util.ComboBoxItem;
import br.edu.fatec.ads.util.FrameUtil;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import org.hibernate.HibernateException;

/**
 *
 * @author Ubirajara
 */
public class FrameAdicionarLivro extends javax.swing.JInternalFrame {

    private List<ComboBoxItem> conteudoTabelaCategoria = null;
    private List<ComboBoxItem> conteudoTabelaAutor = null;
    private Livro livro = null;

    /** Creates new form FrameAdicionarLivro */
    public FrameAdicionarLivro() {
        initComponents();

        FrameUtil.getInstance().removerBarraTitulo(this);

        this.populaComboBoxEditora();
        this.populaComboBoxIdioma();
        this.populaComboBoxCategoria();
        this.populaComboBoxAutor();

        conteudoTabelaAutor = new ArrayList<ComboBoxItem>();
        conteudoTabelaCategoria = new ArrayList<ComboBoxItem>();

        this.setVisible(true);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lblISBN = new javax.swing.JLabel();
        lblTitulo = new javax.swing.JLabel();
        lblEdicao = new javax.swing.JLabel();
        lblEditora = new javax.swing.JLabel();
        lblIdioma = new javax.swing.JLabel();
        txtISBN = new javax.swing.JTextField();
        txtTitulo = new javax.swing.JTextField();
        cmbEditora = new javax.swing.JComboBox();
        cmbIdioma = new javax.swing.JComboBox();
        txtEdicao = new javax.swing.JFormattedTextField();
        btnSalvar = new javax.swing.JButton();
        btnVoltar = new javax.swing.JButton();
        lblCategoria = new javax.swing.JLabel();
        cmbCategoria = new javax.swing.JComboBox();
        scrCategoria = new javax.swing.JScrollPane();
        tblCategoria = new javax.swing.JTable();
        lblAutor = new javax.swing.JLabel();
        cmbAutor = new javax.swing.JComboBox();
        scrAutor = new javax.swing.JScrollPane();
        tblAutor = new javax.swing.JTable();
        btnAdicionaCategoria = new javax.swing.JButton();
        btnAdicionaAutor = new javax.swing.JButton();

        setTitle("Cadastro de Livros");
        setMaximumSize(new java.awt.Dimension(800, 500));
        setPreferredSize(new java.awt.Dimension(800, 500));

        lblISBN.setText("ISBN:");

        lblTitulo.setText("Título:");

        lblEdicao.setText("Edição: ");

        lblEditora.setText("Editora:");

        lblIdioma.setText("Idioma:");

        txtISBN.setName("ISBN"); // NOI18N

        txtTitulo.setName("Título"); // NOI18N

        cmbEditora.setName("Editora"); // NOI18N

        cmbIdioma.setName("Idioma"); // NOI18N

        txtEdicao.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
        txtEdicao.setName("Edição"); // NOI18N

        btnSalvar.setText("Salvar");
        btnSalvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalvarActionPerformed(evt);
            }
        });

        btnVoltar.setText("Voltar");
        btnVoltar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVoltarActionPerformed(evt);
            }
        });

        lblCategoria.setText("Categoria:");

        cmbCategoria.setName("Categoria"); // NOI18N

        tblCategoria.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Código", "Nome"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tblCategoria.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblCategoriaMouseClicked(evt);
            }
        });
        scrCategoria.setViewportView(tblCategoria);
        tblCategoria.getColumnModel().getColumn(0).setResizable(false);
        tblCategoria.getColumnModel().getColumn(1).setResizable(false);

        lblAutor.setText("Autor:");

        cmbAutor.setName("Autor"); // NOI18N

        tblAutor.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Código", "Nome"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tblAutor.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblAutorMouseClicked(evt);
            }
        });
        scrAutor.setViewportView(tblAutor);
        tblAutor.getColumnModel().getColumn(0).setResizable(false);
        tblAutor.getColumnModel().getColumn(1).setResizable(false);

        btnAdicionaCategoria.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/edu/fatec/ads/image/add.png"))); // NOI18N
        btnAdicionaCategoria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAdicionaCategoriaActionPerformed(evt);
            }
        });

        btnAdicionaAutor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/edu/fatec/ads/image/add.png"))); // NOI18N
        btnAdicionaAutor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAdicionaAutorActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(lblEdicao)
                    .addComponent(lblTitulo)
                    .addComponent(lblISBN)
                    .addComponent(lblEditora)
                    .addComponent(lblIdioma)
                    .addComponent(lblCategoria)
                    .addComponent(lblAutor))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(cmbAutor, 0, 608, Short.MAX_VALUE)
                    .addComponent(cmbCategoria, 0, 608, Short.MAX_VALUE)
                    .addComponent(scrAutor, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 608, Short.MAX_VALUE)
                    .addComponent(scrCategoria, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 608, Short.MAX_VALUE)
                    .addComponent(txtEdicao, javax.swing.GroupLayout.DEFAULT_SIZE, 608, Short.MAX_VALUE)
                    .addComponent(txtTitulo, javax.swing.GroupLayout.DEFAULT_SIZE, 608, Short.MAX_VALUE)
                    .addComponent(cmbEditora, 0, 608, Short.MAX_VALUE)
                    .addComponent(cmbIdioma, 0, 608, Short.MAX_VALUE)
                    .addComponent(txtISBN, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(btnVoltar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 484, Short.MAX_VALUE)
                        .addComponent(btnSalvar)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnAdicionaCategoria, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnAdicionaAutor, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(44, 44, 44))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(70, 70, 70)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblISBN)
                    .addComponent(txtISBN, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblTitulo)
                    .addComponent(txtTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblEdicao)
                    .addComponent(txtEdicao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(7, 7, 7)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblEditora)
                    .addComponent(cmbEditora, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblIdioma)
                    .addComponent(cmbIdioma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cmbCategoria, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblCategoria)
                    .addComponent(btnAdicionaCategoria))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(scrCategoria, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cmbAutor, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnAdicionaAutor)
                    .addComponent(lblAutor))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(scrAutor, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(41, 41, 41)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnVoltar)
                    .addComponent(btnSalvar))
                .addContainerGap(47, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnVoltarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVoltarActionPerformed
        FrameUtil.getInstance().alterarTituloJanela(this, null);

        this.dispose();
    }//GEN-LAST:event_btnVoltarActionPerformed

    private void btnAdicionaCategoriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAdicionaCategoriaActionPerformed
        ComboBoxItem itemSelecionado = (ComboBoxItem) cmbCategoria.getSelectedItem();

        if(itemSelecionado != null){
            if(!this.hasItemSelecionadoCategoria(conteudoTabelaCategoria, itemSelecionado)){
                conteudoTabelaCategoria.add(itemSelecionado);

                DefaultTableModel conteudoTabela = (DefaultTableModel) this.tblCategoria.getModel();
                conteudoTabela.addRow(new Object[]{ itemSelecionado.getCodigo(), itemSelecionado.getNome() });

                this.tblCategoria.updateUI();
            }else{
                JOptionPane.showMessageDialog(null, "O item selecionado já foi adicionado a tabela!", "Atenção", JOptionPane.INFORMATION_MESSAGE);
            }
        }else{
            JOptionPane.showMessageDialog(null, "Selecione uma categoria para adição a tabela!", "Atenção", JOptionPane.INFORMATION_MESSAGE);
        }
    }//GEN-LAST:event_btnAdicionaCategoriaActionPerformed

    private void btnAdicionaAutorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAdicionaAutorActionPerformed
        ComboBoxItem itemSelecionado = (ComboBoxItem) cmbAutor.getSelectedItem();

        if(itemSelecionado != null){
            if(!this.hasItemSelecionadoAutor(conteudoTabelaAutor, itemSelecionado)){
                conteudoTabelaAutor.add(itemSelecionado);

                DefaultTableModel conteudoTabela = (DefaultTableModel) this.tblAutor.getModel();
                conteudoTabela.addRow(new Object[]{ itemSelecionado.getCodigo(), itemSelecionado.getNome() });

                this.tblAutor.updateUI();
            }else{
                JOptionPane.showMessageDialog(null, "O item selecionado já foi adicionado a tabela!", "Atenção", JOptionPane.INFORMATION_MESSAGE);
            }
        }else{
            JOptionPane.showMessageDialog(null, "Selecione um autor para adição a tabela!", "Atenção", JOptionPane.INFORMATION_MESSAGE);
        }
    }//GEN-LAST:event_btnAdicionaAutorActionPerformed

    private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed
        // TODO add your handling code here: Efetuar validacao dos campos obrigatorios, e salvar
        List<JComponent> camposValidacao = new ArrayList<JComponent>();
        JComponent[] camposTexto = new JComponent[]{ this.txtISBN, this.txtTitulo, this.txtEdicao };
        JComponent[] camposComboBox = new JComponent[]{ this.cmbEditora, this.cmbIdioma  };

        camposValidacao.addAll(Arrays.asList(camposTexto));
        camposValidacao.addAll(Arrays.asList(camposComboBox));

        List<String> erros = FrameUtil.getInstance().validaCampos(camposValidacao);

        if(erros != null && !erros.isEmpty()){
            for (String campo : erros) {
                JOptionPane.showMessageDialog(null, String.format("%s é um campo obrigatório!", campo), "Atenção!", JOptionPane.INFORMATION_MESSAGE);
            }
        }else{
            if(FrameUtil.getInstance().isInteger(txtEdicao.getText())){
                if(!conteudoTabelaAutor.isEmpty() && !conteudoTabelaCategoria.isEmpty()){
                    livro = new Livro();

                    livro.setIsbn(txtISBN.getText());
                    livro.setTitulo(txtTitulo.getText());
                    livro.setEdicao(Integer.parseInt(txtEdicao.getText()));
                    livro.setEmprestado(false);

                    ComboBoxItem editoraSelecionada = (ComboBoxItem) cmbEditora.getSelectedItem();
                    livro.setEditora(new Editora(editoraSelecionada.getCodigo()));

                    ComboBoxItem idiomaSelecionada = (ComboBoxItem) cmbIdioma.getSelectedItem();
                    livro.setIdioma(new Idioma(idiomaSelecionada.getCodigo()));

                    try{
                        FacadeLivro.getInstance().inserir(livro, conteudoTabelaCategoria, conteudoTabelaAutor);

                        JOptionPane.showMessageDialog(null, "Sucesso na inserção do livro!", "Sucesso!", JOptionPane.INFORMATION_MESSAGE);

                        this.limparCampos();
                    }catch(HibernateException cause){
                        JOptionPane.showMessageDialog(null, cause.getMessage(), "Atenção", JOptionPane.ERROR_MESSAGE);
                    }

                }else{
                    JOptionPane.showMessageDialog(null, "Você deve adicionar ao menos 1 autor e 1 categoria para a inserção do livro!", "Atenção!", JOptionPane.INFORMATION_MESSAGE);
                }
            }else{
                JOptionPane.showMessageDialog(null, "São aceitos somentes números no campo Edição!", "Atenção!", JOptionPane.INFORMATION_MESSAGE);
            }
        }

    }//GEN-LAST:event_btnSalvarActionPerformed

    private void tblCategoriaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblCategoriaMouseClicked
        if(evt.getClickCount() == 2){
            int linhaTabela = tblCategoria.getSelectedRow();

            if(linhaTabela > -1){
                conteudoTabelaCategoria.remove(linhaTabela);

                DefaultTableModel conteudoTabela = (DefaultTableModel) tblCategoria.getModel();
                conteudoTabela.removeRow(linhaTabela);

                tblCategoria.setModel(conteudoTabela);
                tblCategoria.updateUI();
            }
        }
    }//GEN-LAST:event_tblCategoriaMouseClicked

    private void tblAutorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblAutorMouseClicked
        if(evt.getClickCount() == 2){
            int linhaTabela = tblAutor.getSelectedRow();

            if(linhaTabela > -1){
                conteudoTabelaAutor.remove(linhaTabela);

                DefaultTableModel conteudoTabela = (DefaultTableModel) tblAutor.getModel();
                conteudoTabela.removeRow(linhaTabela);

                tblAutor.setModel(conteudoTabela);
                tblAutor.updateUI();
            }
        }
    }//GEN-LAST:event_tblAutorMouseClicked

    private boolean hasItemSelecionadoCategoria(List<ComboBoxItem> categorias, ComboBoxItem itemSelecionado){
        boolean validacao = false;

        if(categorias != null && !categorias.isEmpty()){
            for (ComboBoxItem comboBoxItem : categorias) {
                if(comboBoxItem.getCodigo() == itemSelecionado.getCodigo()){
                    validacao = true;

                    break;
                }
            }
        }

        return validacao;
    }

    private boolean hasItemSelecionadoAutor(List<ComboBoxItem> autores, ComboBoxItem itemSelecionado){
        boolean validacao = false;

        if(autores != null && !autores.isEmpty()){
            for (ComboBoxItem comboBoxItem : autores) {
                if(comboBoxItem.getCodigo() == itemSelecionado.getCodigo()){
                    validacao = true;
                    break;
                }
            }
        }

        return validacao;
    }

    private void populaComboBoxEditora(){
        List<ComboBoxItem> items = FacadeEditora.getInstance().recuperarEditoras();
        ComboBoxModel comboItems = new DefaultComboBoxModel(items.toArray());

        this.cmbEditora.setModel(comboItems);
    }

    private void populaComboBoxIdioma(){
        List<ComboBoxItem> items = FacadeIdioma.getInstance().recuperarIdiomas();
        ComboBoxModel comboItems = new DefaultComboBoxModel(items.toArray());

        this.cmbIdioma.setModel(comboItems);
    }

    private void populaComboBoxCategoria(){
        List<ComboBoxItem> items = FacadeCategoria.getInstance().recuperarCategorias();
        ComboBoxModel comboItems = new DefaultComboBoxModel(items.toArray());

        this.cmbCategoria.setModel(comboItems);
    }

    private void populaComboBoxAutor(){
        List<ComboBoxItem> items = FacadeAutor.getInstance().recuperarTodosAutores();
        ComboBoxModel comboItems = new DefaultComboBoxModel(items.toArray());

        this.cmbAutor.setModel(comboItems);
    }

    private void limparCampos(){
        this.cmbEditora.setSelectedIndex(FrameUtil.FIRST_SELECT);
        this.cmbIdioma.setSelectedIndex(FrameUtil.FIRST_SELECT);
        this.cmbAutor.setSelectedIndex(FrameUtil.FIRST_SELECT);
        this.cmbCategoria.setSelectedIndex(FrameUtil.FIRST_SELECT);

        this.txtTitulo.setText(FrameUtil.BLANK);
        this.txtISBN.setText(FrameUtil.BLANK);
        this.txtEdicao.setText(FrameUtil.BLANK);

        FrameUtil.getInstance().limparTable(this.tblAutor);
        FrameUtil.getInstance().limparTable(this.tblCategoria);

        this.conteudoTabelaAutor = new ArrayList<ComboBoxItem>();
        this.conteudoTabelaCategoria = new ArrayList<ComboBoxItem>();
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAdicionaAutor;
    private javax.swing.JButton btnAdicionaCategoria;
    private javax.swing.JButton btnSalvar;
    private javax.swing.JButton btnVoltar;
    private javax.swing.JComboBox cmbAutor;
    private javax.swing.JComboBox cmbCategoria;
    private javax.swing.JComboBox cmbEditora;
    private javax.swing.JComboBox cmbIdioma;
    private javax.swing.JLabel lblAutor;
    private javax.swing.JLabel lblCategoria;
    private javax.swing.JLabel lblEdicao;
    private javax.swing.JLabel lblEditora;
    private javax.swing.JLabel lblISBN;
    private javax.swing.JLabel lblIdioma;
    private javax.swing.JLabel lblTitulo;
    private javax.swing.JScrollPane scrAutor;
    private javax.swing.JScrollPane scrCategoria;
    private javax.swing.JTable tblAutor;
    private javax.swing.JTable tblCategoria;
    private javax.swing.JFormattedTextField txtEdicao;
    private javax.swing.JTextField txtISBN;
    private javax.swing.JTextField txtTitulo;
    // End of variables declaration//GEN-END:variables

}
